package com.dabai.iot.core.tsl.specs;

import com.alibaba.fastjson2.annotation.JSONField;
import com.dabai.iot.core.entity.ThingModelItemEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class TslBoolSpec implements TslDataSpec {

    /**
     * 布尔值true
     */
    @Schema(description = "布尔值true")
    @JSONField(ordinal = 1)
    private String trueDesc;

    /**
     * 布尔值false
     */
    @Schema(description = "布尔值false")
    @JSONField(ordinal = 2)
    private String falseDesc;

    @Override
    public TslBoolSpec createSpec(ThingModelItemEntity item) {
        TslBoolSpec spec = new TslBoolSpec();
        spec.setTrueDesc(item.getTrueDesc());
        spec.setFalseDesc(item.getFalseDesc());
        return spec;
    }

}
